package com.leejw.tradeblogsystem.controller;

import com.leejw.tradeblogsystem.model.User;
import com.leejw.tradeblogsystem.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author: jwli3
 * @Desc:
 * @create: 2024-08-15
 **/
@Controller
public class LoginController {

    @Autowired
    private UserService service;

    @RequestMapping("/")
    public String index(){
        return "login.html";
    }

//    @ResponseBody
//    @RequestMapping("/index")
//    public String index(@RequestBody User user) {
//        String name = user.getName();
//        String password = user.getPassword();
//        User result = service.login(name, password);
//        if (result == null) {
//            return "USER_NOT_EXIST";
//        }
//        return "SUCCESS";
//    }
}
